package com.happy3w.ssp.schoolmatehome.component.stub;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@ConfigurationProperties(prefix = " ")
@Data
public class StubConfig {
    private List<StubItem> stubs;

    public StubItem findItem(String code) {
        if (stubs == null) {
            return null;
        }
        for (StubItem item : stubs) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
}
